Project DataPackets before AI prompt serialization#1800
Conversation
Homeboy Results —
|
|
Review blocker before merge:
Please preserve CI is green and the overall architecture looks right; this should be a small targeted follow-up. |
|
Review blocker addressed in follow-up commit Changes:
Verification rerun:
|
|
Second blocker after the snippet-array fix: The projection still re-adds the raw JSON source object through the Current shape: $source = self::decodeJsonObject( $data['body'] ?? null );
...
'body' => self::firstString( $source, $data, array(), array( 'content', 'body', 'text', 'summary', 'description' ) ),For real MGS search packets, That defeats the main dedupe goal: the prompt still gets the raw source object, plus flattened fields/snippets. Please change the logic so a successfully decoded JSON wrapper body is not reused as the projected body fallback. Use body/content fields from the decoded source if present, or use wrapper |
|
Architecture blocker: this currently makes Data Machine aware of Intelligence/MCP packet internals. I verified ownership:
PR #1800 currently adds MCP-specific packet projection to Data Machine:
That crosses the Data Machine/Intelligence boundary. Recommended revision:
This PR should not merge with MCP-specific key knowledge in Data Machine core. |
|
Architecture blocker addressed in follow-up commit Changes:
Verification rerun:
I also searched the Data Machine projection files/tests for the blocked MCP/MGS key names; no matches remain in the changed projection surface. |
|
Final API hardening request before merge: Please add a minimal, source-agnostic context array as the third filter argument. Current: apply_filters( 'datamachine_ai_project_data_packet', $projected, $packet );Target: apply_filters(
'datamachine_ai_project_data_packet',
$projected,
$packet,
$context
);Context should stay generic, for example Please update |
|
Final API hardening addressed in follow-up commit Changes:
Verification rerun:
|
Summary
DataPacketPromptProjectorso AI prompts receive compact packet projections while canonical DataPackets remain unchanged for storage, replay, and downstream engine state.AIStepandRequestInspector, remove pretty-printed prompt packet JSON, and report canonical vs projected packet byte metrics.data.body, preserving useful source/provenance fields, stripping<em>snippet highlights, and omitting duplicate raw MCP metadata.Closes #1799.
Tests
php tests/ai-packet-projection-smoke.phpphp tests/ai-request-inspector-smoke.php./vendor/bin/phpcs inc/Engine/AI/DataPacketPromptProjector.php inc/Core/Steps/AI/AIStep.php inc/Engine/AI/RequestInspector.php inc/Cli/Commands/AICommand.php tests/ai-packet-projection-smoke.php tests/ai-request-inspector-smoke.php tests/Unit/Core/Steps/AI/AIStepTest.phpgit diff --checkAdditional test signal
composer test -- --filter AIStepTestran the full Homeboy/Playground suite instead of honoring the filter: 1,211 tests, 1 unrelated failure inDataMachine\\Tests\\Unit\\Abilities\\ImageGenerationPromptRefinementTest::test_refine_prompt_includes_post_context_when_provided(''did not containArticle context:). The AI step tests passed during that run.AI assistance